package com.ibeeking.found.upms.service.common.param;

import com.ibeeking.nematos.utils.base.BaseValidationGroup;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * @ClassName ResourceParam
 * @Description
 * @Author ibeeking
 * @Date 2020-12-07 09:09
 **/
@Data
public class ResourceParam implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @NotNull(message = "Id不能为空", groups = {BaseValidationGroup.Update.class})
    private Long id;

    /**
     * 上级资源id
     */
    @NotNull(message = "父级id不能为空", groups = {BaseValidationGroup.Insert.class})
    private Long parentId;

    /**
     * 资源所属服务编码
     */
    private Integer serviceId;

    /**
     * 资源名称
     */
    @NotBlank(message = "资源名称不能为空", groups = {BaseValidationGroup.Insert.class, BaseValidationGroup.Update.class})
    private String name;

    /**
     * 资源路径
     */
    private String resource;

    /**
     * 描述
     */
    private String description;

    /**
     * 资源名称类型，1-目录，2-模块，3-资源
     */
    @NotNull(message = "资源名称类型不能为空", groups = {BaseValidationGroup.Insert.class})
    private Integer type;

    /**
     * 排序
     */
    @NotNull(message = "排序不能为空", groups = {BaseValidationGroup.Insert.class, BaseValidationGroup.Update.class})
    private Integer sort;

    /**
     * 创建人
     */
    private Long createBy;

    /**
     * 更新人
     */
    private Long modifyBy;
}
